
import { renderFile, render, parse, compile } from 'nuejs-core';

const component = `
<section @name="image-gallery" class="gallery">

  <div>
    <a class="seek prev" @click="index--" :if="index"></a>

    <img src="{ basedir }/{ images[index] }">

    <a class="seek next" @click="index++"
      :if="images.length - index > 1"></a>
  </div>

  <nav>
    <a :for="src, i in images"
      class="{ current: i == index }"
      @click="index = i"></a>
  </nav>

  <script>
    index = 0
  </script>

</section>
`

// render the component with some data
const html = compile(component)
// output
console.info(html)